const Mock = require('mockjs');
const login = require('./login');
const menus = require('./menus');
const students = require('./students')

const mocks = [login, menus,students];

mocks.forEach((item) => {
  if (Array.isArray(item)){
    item.forEach(item=>{
      Mock.mock(new RegExp(item.path), item.type, (ops) => {
        return item.func(ops);
      })
    })
  }
  else {
    Mock.mock(new RegExp(item.path), item.type, (ops) => {
      return item.func(ops);
    })
  }
});
